#ifndef WOBJECT_H
#define WOBJECT_H

struct objectdata {
	void* objectpoint;
};
extern objectdata* objectlist;
extern pthread_mutex_t pfreeobject;
extern int curobject;

struct _CPoint {
	int x, y;
	_CPoint() {}
	_CPoint(int _x, int _y) {x = _x;y = _y;}
	_CPoint(const _CPoint& p) {x = p.x;y = p.y;}
	_CPoint operator = (const _CPoint& _p) {x = _p.x;y = _p.y;return *this;}
	bool operator == (const _CPoint& _p) {return (x == _p.x && y == _p.y);}
};

class CObject
{
public:
	CObject();
	~CObject();

	std::string classname;
	int objectid;
	_CPoint pos;
};

extern int getnewobjectid();
extern CObject* getObjectByObjectID(int objectid);
extern int createObject();
extern void removeObject(int objectid);

#endif // WOBJECT_H
